﻿using System;
using UdpAuthorizationService.Core;
using UdpAuthorizationService.Core.Logging;

namespace UdpAuthorization.Console
{
	class Program
	{
		static void Main(string[] args)
		{
			LoggingFacade.RegisterLogger<ConsoleLogger>();

			try
			{
				var manager = new AuthorizationManager();
				manager.Start();
				System.Console.ReadLine();
				manager.Stop();
			}
			catch (Exception exception)
			{
				LoggingFacade.Logger.Log(new LogEvent(Severity.Error, "Execution error: " + exception.Message));
				System.Console.ReadLine();
				throw;
			}
		}
	}
}
